import 'package:flutter/material.dart';

class TextExhibitionCardWidget extends StatefulWidget {
  final String title;
  final String exhibitionText;
  final EdgeInsets distance;
  final Border border;
  final Color exhibitionTextColor;
  final CrossAxisAlignment position;
  TextExhibitionCardWidget(
      {@required this.title,
      @required this.exhibitionText,
      this.distance,
      this.border =
          const Border(top: BorderSide(width: 1, color: Color(0xffdddddd))),
      this.position = CrossAxisAlignment.end,
      this.exhibitionTextColor = const Color(0xFF999999)});

  @override
  State<StatefulWidget> createState() {
    return TextExhibitionCardWidgetState();
  }
}

class TextExhibitionCardWidgetState extends State<TextExhibitionCardWidget> {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: widget.distance,
      decoration: BoxDecoration(color: Colors.white, border: widget.border),
      child: Row(
        children: <Widget>[
          Container(
              margin: EdgeInsets.only(right: 8),
              child: Text(
                widget.title,
                style: TextStyle(fontSize: 16, color: Color(0xFF323232)),
              )),
          Expanded(
              child: Column(
            crossAxisAlignment: widget.position,
            children: <Widget>[
              Text(widget.exhibitionText,
                  style: TextStyle(
                      fontSize: 16, color: widget.exhibitionTextColor))
            ],
          ))
        ],
      ),
    );
  }
}
